<div class="addinforWrap" id="design">
    <div class="container">
		<div class="title" >
		<p>简单填写表格，获取精准分析</p>
	</div>
		<div class="aicon clearfix">
        <div class="aileft col-xs-4">
			<div class="item col-xs-6">
				<a href="#">
				<div class="icon">
					<img src="__STATIC__/images/index/qm_31.png" />
				</div>
				<p>免费规划需求</p>
				</a>
			</div>
			<div class="item  col-xs-6">
				<a href="#">
				<div class="icon">
					<img src="__STATIC__/images/index/qm_32.png" />
				</div>
				<p>免费申请域名</p>
				</a>
			</div>
			<div class="item  col-xs-6">
				<a href="#">
				<div class="icon">
					<img src="__STATIC__/images/index/qm_33.png" />
				</div>
				<p>免费预算报价</p>
				</a>
			</div>
			<div class="item  col-xs-6">
				<a href="#">
				<div class="icon">
					<img src="__STATIC__/images/index/qm_34.png" />
				</div>
				<p>免费出效果图</p>
				</a>
			</div>
		</div>
        <div class="aiRight col-xs-8">
		<form id="myform" action="">

			<div class="aiinputWrap clearfix">
				<div class="col-xs-6">
					<div class="aiBox">

						<input type="text" name="mianji" id="mianji" placeholder="请输入项目需求：" required/>
					</div>
				</div>
				<div class="col-xs-6">
					<div class="aiBox">

						<input type="text" name="contacts" id="contacts" placeholder="请输入您的姓名:" required/>
					</div>
				</div>
			</div>
			<div class="aiinputWrap">
				<div class="col-xs-12">
					<div class="aiBox">

						<input type="text" name="mobile"  id="mobile" placeholder="请输入您的电话:" required/>
					</div>
				</div>
			</div>
			<div class="aiBtn col-xs-12">
				<a href="javascript:;" id="submitForm">免费获取设计服务</a>
			</div>
			<p class="tips">* 您的输入信息将会被保密处理，请放心填写</p>
		</div>
		</form>
    </div>
		</div>
</div>
<script src="__STATIC__/js/layer/layer.js"></script>
<script>
    $("#submitForm").click(function () {
		var mianji = $('#mianji').val();
		if(!mianji) {
			layer.msg('请填写项目需求');return false;
		}
		var contacts = $('#contacts').val();
		if(!contacts){
			layer.msg('请填写联系人姓名');return false;
		}
		var mobile = $('#mobile').val();
		if(!mobile || !isPhoneNo(mobile)){
			layer.msg('请填写正确的手机号');return false;
		}
		var input_val = {
            contacts: contacts,
			mianji: mianji,
            mobile: mobile
        };	
        $.ajax({
            type: "post",
            url: "Freedbook",
            data: input_val,
            success: function (result) {
                if (result.status === 1) {
					 layer.msg(result.info);
					 $('#mianji').val('');
					 $('#contacts').val('');
					 $('#mobile').val('');
					 
                }else{
					layer.msg(result.info);
				}
            }
        });
    });
	function isPhoneNo(phone) {
        var pattern = /^1[345789]([0-9]{9})$/;
        return pattern.test(phone);
    }
</script>